{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import requests\n",
    "import time \n",
    "import json\n",
    "import sqlite3 as sql"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "lst_city = ['武汉','北京','上海','广州','深圳','成都','长沙','广州','重庆']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num = 1\n",
    "url_api = r'http://restapi.amap.com/v3/place/text'\n",
    "pois_all = [] \n",
    "while num <= 20:\n",
    "    city_name = city\n",
    "    num_page = num\n",
    "    dic = {'key':'a116cd29b51b3e642af47a866dd35076',\n",
    "            'keywords':'广顺北大街31号院夏都家园3号楼',\n",
    "            'city':city_name,\n",
    "            'offset':'20',\n",
    "            'output':'json',\n",
    "            'extensions':'all',\n",
    "            'page':num_page\n",
    "          }\n",
    "    try:\n",
    "        req = requests.get(url_api,params=dic)\n",
    "        json_one = json.loads(req.text)\n",
    "        pois = json_one['pois']\n",
    "    except IndexError as e:\n",
    "        print('except', e)\n",
    "    finally:\n",
    "        pois = json_one['pois']\n",
    "        pois_all.append(pois)\n",
    "    num = num + 1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "url_api = r'http://restapi.amap.com/v3/place/text'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'city': '武汉',\n",
       " 'extensions': 'all',\n",
       " 'key': 'a116cd29b51b3e642af47a866dd35076',\n",
       " 'keywords': '广顺北大街31号院夏都家园3号楼',\n",
       " 'offset': '20',\n",
       " 'output': 'json',\n",
       " 'page': 1}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dic = {'key':'a116cd29b51b3e642af47a866dd35076',\n",
    "               'keywords':'广顺北大街31号院夏都家园3号楼',\n",
    "               'city':lst_city[0],\n",
    "               'offset':'20',\n",
    "               'output':'json',\n",
    "               'extensions':'all',\n",
    "               'page':1\n",
    "              }\n",
    "dic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'count': '55',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'adcode': '110105',\n",
       "   'address': '广顺北大街31号院-3',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '4.0'},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFILDJ19',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467373,39.996197',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园3号楼',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '3',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '地名地址信息;门牌信息;楼栋号',\n",
       "   'typecode': '190403',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院2号',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFIPRVZ5',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466570,39.996009',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园2号楼',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '地名地址信息;门牌信息;楼栋号',\n",
       "   'typecode': '190403',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFILF3OR',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466354,39.996422',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园1号楼',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '地名地址信息;门牌信息;楼栋号',\n",
       "   'typecode': '190403',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '朝阳区',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFH13WZM',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466632,39.994943',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园5号楼',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '地名地址信息;门牌信息;楼栋号',\n",
       "   'typecode': '190403',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '朝阳区',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFH14I0Y',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466476,39.995312',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园6号楼',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '地名地址信息;门牌信息;楼栋号',\n",
       "   'typecode': '190403',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院夏都家园3号楼',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFG7H63A',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467484,39.996085',\n",
       "   'match': '0',\n",
       "   'name': '航空售票(广顺北大街)',\n",
       "   'navi_poiid': 'J50F001020_337266',\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb0eb'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': '010-64711865',\n",
       "   'timestamp': [],\n",
       "   'type': '生活服务;售票处;飞机票代售点',\n",
       "   'typecode': '070301',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院夏都家园3号楼底商201室(近15号地铁望京站福码大厦、嘉茂华联百货、北京移动大厦、望京新城4区)',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '3.5'},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B000A8W9OK',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467340,39.996517',\n",
       "   'match': '0',\n",
       "   'name': '京延口腔',\n",
       "   'navi_poiid': 'J50F001020_281140',\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb104'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e7af5bc4e753f807bb8227e21ab0313a'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2c11bdd6cfda8eda210f6aa9f88f26e3'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': '010-64737879',\n",
       "   'timestamp': [],\n",
       "   'type': '医疗保健服务;专科医院;口腔医院|医疗保健服务;诊所;诊所',\n",
       "   'typecode': '090202|090300',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院夏都家园3号楼一层101室底商',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFJ2FUIO',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467361,39.996361',\n",
       "   'match': '0',\n",
       "   'name': '木北造型',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '生活服务;美容美发店;美容美发店',\n",
       "   'typecode': '071100',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院夏都家园3号楼',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': '链家地产(夏都盈座店)',\n",
       "   'biz_ext': {'cost': [], 'rating': '2.0'},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': '116.467912,39.996152',\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B000A819YM',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467484,39.996130',\n",
       "   'match': '0',\n",
       "   'name': '链家(夏都盈座店)',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb0e9'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/30b9a5bbabcfd3239639ec551a56fd6b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a074f247f7be71d13ad587869a40df77'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': '4007001001',\n",
       "   'timestamp': [],\n",
       "   'type': '生活服务;中介机构;中介机构',\n",
       "   'typecode': '071600',\n",
       "   'website': 'www.homelink.com.cn'},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街35号附近',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFIUHTW3',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467479,39.995841',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园(南门)',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'typecode': '991400',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号楼附近',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': '116.466023,39.997102',\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B000A83KVG',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466643,39.996975',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园停车场',\n",
       "   'navi_poiid': 'J50F001020_667663',\n",
       "   'parking_type': '地面',\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/d4d0410bc4304857099497943f5d023b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb07c'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '交通设施服务;停车场;公共停车场',\n",
       "   'typecode': '150904',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31附近',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFIY04UY',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467760,39.996190',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园停车场望京西园-419号楼西',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '交通设施服务;停车场;停车场相关',\n",
       "   'typecode': '150900',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '望京街道广顺北大街31号楼夏都家园一号',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFGVW28M',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466817,39.996817',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园良子健身',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '体育休闲服务;体育休闲服务场所;体育休闲服务场所',\n",
       "   'typecode': '080000',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号夏都家园',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B000A8WD7C',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467281,39.995985',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园停车场',\n",
       "   'navi_poiid': 'J50F001020_337157',\n",
       "   'parking_type': '地下',\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/99ccc57d36abfb7e5af207424f95152a'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb0d7'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a04bb57b1f27cc1a2b89a599c014cace'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '交通设施服务;停车场;公共停车场',\n",
       "   'typecode': '150904',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号楼附近',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFH7OBTI',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.467165,39.996936',\n",
       "   'match': '0',\n",
       "   'name': '夏都家园地上停车场',\n",
       "   'navi_poiid': 'J50F001020_341994',\n",
       "   'parking_type': '地面',\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '2',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '交通设施服务;停车场;公共停车场',\n",
       "   'typecode': '150904',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街夏都家园31号院1号楼',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': '畅优苑纤体丰胸馆',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B000A8VRQX',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466515,39.996871',\n",
       "   'match': '0',\n",
       "   'name': '审美护肤造型(湖光中街)',\n",
       "   'navi_poiid': 'J50F001020_276804',\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a39f66764677f464a9ae08b40f668674'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ffe5c1ee2463deb4ff0a13e6d02e3d8b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a8e559a31013cc726bb054'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': '010-84728876',\n",
       "   'timestamp': [],\n",
       "   'type': '生活服务;美容美发店;美容美发店',\n",
       "   'typecode': '071100',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '望京广顺北大街31号院夏都家园2号楼',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739711',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFIBSFRC',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466759,39.996101',\n",
       "   'match': '0',\n",
       "   'name': '经典时尚',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '购物服务;服装鞋帽皮具店;服装鞋帽皮具店',\n",
       "   'typecode': '061100',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号夏都家园3号楼B单元505室',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFFRGMYS',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466408,39.996800',\n",
       "   'match': '0',\n",
       "   'name': '海玲英成人教育培训中心',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': '010-64711479',\n",
       "   'timestamp': [],\n",
       "   'type': '科教文化服务;培训机构;培训机构',\n",
       "   'typecode': '141400',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31号院夏都家园1号楼1层102号',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': [],\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFIWQ3KW',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466354,39.996422',\n",
       "   'match': '0',\n",
       "   'name': '茅台专卖店',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': [],\n",
       "   'timestamp': [],\n",
       "   'type': '购物服务;购物相关场所;购物相关场所',\n",
       "   'typecode': '060000',\n",
       "   'website': []},\n",
       "  {'adcode': '110105',\n",
       "   'address': '广顺北大街31院夏都家园1号楼B单元1层',\n",
       "   'adname': '朝阳区',\n",
       "   'alias': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'biz_type': [],\n",
       "   'business_area': '望京',\n",
       "   'children': [],\n",
       "   'citycode': '010',\n",
       "   'cityname': '北京市',\n",
       "   'discount_num': '0',\n",
       "   'distance': [],\n",
       "   'email': [],\n",
       "   'entr_location': '116.466651,39.996942',\n",
       "   'event': [],\n",
       "   'exit_location': [],\n",
       "   'gridcode': '5916739710',\n",
       "   'groupbuy_num': '0',\n",
       "   'id': 'B0FFG7MGOA',\n",
       "   'importance': [],\n",
       "   'indoor_data': {'cmsid': [], 'cpid': [], 'floor': [], 'truefloor': []},\n",
       "   'indoor_map': '0',\n",
       "   'location': '116.466655,39.996837',\n",
       "   'match': '0',\n",
       "   'name': '艺佳达家电维修',\n",
       "   'navi_poiid': [],\n",
       "   'pcode': '110000',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/6fbdbaec475faebaf315c59a74350e55'}],\n",
       "   'pname': '北京市',\n",
       "   'poiweight': [],\n",
       "   'postcode': [],\n",
       "   'recommend': '0',\n",
       "   'shopid': [],\n",
       "   'shopinfo': '0',\n",
       "   'tag': [],\n",
       "   'tel': '010-64226822;13611018039',\n",
       "   'timestamp': [],\n",
       "   'type': '生活服务;维修站点;维修站点',\n",
       "   'typecode': '071200',\n",
       "   'website': []}],\n",
       " 'status': '1',\n",
       " 'suggestion': {'cities': [], 'keywords': []}}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "req = requests.get(url_api,params=dic)\n",
    "json_one = json.loads(req.text)\n",
    "json_one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "pois = json_one['pois']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'39.996197'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pois[0]['location'].split(',')[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
